/* eslint-disable import/prefer-default-export */
/* 个人主页新增接口 */
import request from '@/utils/request';
/**
 *个人主页-常用流程列表
 */
export async function getMyFrequentWorkflow(parmas) {
    return request('/api/workflowweb/processinstance/v1/myfrequentworkflow', {
        method: 'POST',
        data: parmas
    });
}
/**
 * 个人主页-快捷功能列表
 */
export async function getMyFrequentMenu() {
    return request('/api/oa/v1/self/settings/getMyFrequentMenu', {
        method: 'POST'
    });
}
/**
 * 添加快捷功能弹出框流程展示
 */
export async function displayAllPersonalMenu() {
    return request('/api/oa/v1/self/settings/displayAllPersonalMenu', {
        method: 'POST'
    });
}
/**
 * 添加常用流程弹出框流程展示
 */
export async function displayAllPersonalWorkflow(params) {
    return request('/api/workflowweb/processinstance/v1/displayallpersonalworkflow', {
        method: 'POST',
        data: params
    });
}
/**
 * 添加快捷功能弹出框提交快捷功能
 */
export async function submitSelectedPersonalMenu(params) {
    return request('/api/oa/v1/self/settings/submitSelectedPersonalMenu', {
        method: 'POST',
        data: params
    });
}
/**
 * 添加常用流程弹出框提交常用流程
 */
export async function submitSelectedPersonalWorkflow(params) {
    return request('/api/workflowweb/processinstance/v1/submitunselectedpersonalworkflow', {
        method: 'POST',
        data: params
    });
}
/**
 * 获取员工入职天数
 */
export async function getWorkingDays(params) {
    return request('/api/oa/v1/self/settings/workingDays', {
        method: 'POST',
        data: params
    });
}
/**
 *保存模块
 *
 * @export POST
 * @returns
 */
export async function savePersonalModules(params) {
    return request('/api/oa/v1/self/settings/createOrUpdate', {
        method: 'POST',
        data: params
    });
}

/**
 *获取个人模块
 *
 * @export POST
 * @returns
 */
export async function getPersonalModules() {
    return request('/api/oa/v1/self/settings/getPersonEmployeeModule', {
        method: 'POST'
    });
}

/**
 *获取所有模块
 *
 * @export POST
 * @returns
 */
export async function getAllModules() {
    return request('/api/oa/v1/self/settings/getPersonDesktopModule', {
        method: 'POST'
    });
}
/**
 * 招聘需求--我的招聘需求列表
 * required: userCode
 */
export async function getcompanylist(params) {
    return request('/api/oa/v1/recruit/getcreatlist', {
        method: 'POST',
        data: params
    });
}
/**
 * 招聘需求--我的招聘任务列表
 *  required: employeeId
 */
export async function getmylist(params) {
    return request('/api/oa/v1/recruit/getmylist', {
        method: 'POST',
        data: params
    });
}
/**
 * 招聘需求--我的offer列表
 * required: leaderIds
 */
export async function getmyofferlist(params) {
    return request('/api/oa/v1/offer/getmyofferlist', {
        method: 'POST',
        data: params
    });
}

/**
 *获取公告规章数据
 *
 * @export GET
 * @returns
 */
export async function getDoorList() {
    return request('/api/oa/v1/protal/getlist');
}
// 经我审批流程列表
export async function getPass(params) {
    return request('/api/oa/v1/workflow/passmeprocess/getpassmeprocesslist', {
        method: 'POST',
        data: params
    });
}
// 经我阅读列表【我的抄送列表-分页
export async function getRead(params) {
    return request('/api/oa/v1/workflow/reading/getlist', {
        method: 'POST',
        data: params
    });
}

/**
 * 新流程
 * */

// 经我审批流程列表
export function getAuditedList(params) {
    return request('/api/workflowweb/approve/v1/done/list', {
        method: 'POST',
        data: params
    });
}

// 经我阅读列表【我的抄送列表-分页
export function getReadList(params) {
    return request('/api/workflowweb/approve/v1/cc/list', {
        method: 'POST',
        data: params
    });
}
// 待我审批列表
export async function getWaitApprovalList(params) {
    return request('/api/workflowweb/approve/v1/doing/list', {
        method: 'POST',
        data: params
    });
}

// 获取用户待办数量
export function fetchSelfTaskCount() {
    return request('/api/messagecenter/taskpool/v1/selfTaskCount', {
        method: 'GET'
    });
}

export function fetchSelfTask(params) {
    return request('/api/messagecenter/taskpool/v1/self/task', {
        method: 'POST',
        data: params
    });
}

export function getMyApply(params) {
    return request('/api/workflowweb/approve/v1/initiator/list', {
        method: 'POST',
        data: params
    });
}

// 常用入口
export function getCommonEntrance() {
    return request('/api/oa/v1/self/settings/getCommonEntrance', {
        method: 'GET'
    });
}

export function saveCommonEntrance(params) {
    return request('/api/oa/v1/self/settings/saveCommonEntrance', {
        method: 'POST',
        data: params
    });
}
